package top.kaoshanji.p2ch06a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Objects;

/**
 * 代码清单 p2ch06a-11：Objects类的equals方法的使用示例
 * author kaoshanji
 * ^_^
 * create time 2025/1/17 19:08
 */
public class ObjectsExample02 {

    private static final Logger logger = LogManager.getLogger(ObjectsExample02.class);

    public static void main(String[] args) {
        logger.info("...代码清单 p2ch06a-11：Objects类的equals方法的使用示例...");

        boolean value1 = Objects.equals(new Object(), new Object());
        logger.info("...value1:{}...", value1);

        Object[] array1 = new Object[]{"Hello", 1, 1.0};
        Object[] array2 = new Object[]{"Hello", 1, 1.5};
        boolean value2 = Objects.deepEquals(array1, array2);
        logger.info("...value2:{}...", value2);

    }

}
